const Base = require('../../base.js');

module.exports = class extends Base {
  async indexAction() {
    let admin_login = await this.session('admin_login')
    if (!admin_login) {
      return this.fail(-1, '未授權的訪問')
    }

    let data = this.post()
    await this.model('task/index').add(data)
    
    this.json({
      status: 200,
      message: 'success'
    })
  }
};
